package com.hibernate.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Max;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.javacommon.base.BaseEntity;
import org.hibernate.validator.constraints.Length;

/**
 * 
 */

@Entity
@Table(name = "T_IP_REGION_ZONE_CN")
public class TipRegionZoneCn extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "TipRegionZoneCn";
	public static final String ALIAS_CITYID = "cityid";
	public static final String ALIAS_POID = "poid";
	public static final String ALIAS_TITLE = "title";
	public static final String ALIAS_PINYIN = "pinyin";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * cityid       db_column: CITYID 
     */ 	
	@Max(32767)
	private Integer cityid;
    /**
     * poid       db_column: POID 
     */ 	
	@Max(32767)
	private Integer poid;
    /**
     * title       db_column: TITLE 
     */ 	
	@Length(max=200)
	private java.lang.String title;
    /**
     * pinyin       db_column: PINYIN 
     */ 	
	@Length(max=100)
	private java.lang.String pinyin;
	
	private Integer isshow;
	//columns END

	@Column(name = "ISSHOW")
	public Integer getIsshow() {
		return isshow;
	}

	public void setIsshow(Integer isshow) {
		this.isshow = isshow;
	}
	

	public TipRegionZoneCn(){
	}

	public TipRegionZoneCn(
		Integer cityid
	){
		this.cityid = cityid;
	}

	

	public void setCityid(Integer value) {
		this.cityid = value;
	}
	
	@Id 	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "native") 
	@Column(name = "CITYID", unique = true, nullable = false, insertable = true, updatable = true, length = 4)
	public Integer getCityid() {
		return this.cityid;
	}
	
	@Column(name = "POID", unique = false, nullable = true, insertable = true, updatable = true, length = 4)
	public Integer getPoid() {
		return this.poid;
	}
	
	public void setPoid(Integer value) {
		this.poid = value;
	}
	
	@Column(name = "TITLE", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getTitle() {
		return this.title;
	}
	
	public void setTitle(java.lang.String value) {
		this.title = value;
	}
	
	@Column(name = "PINYIN", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getPinyin() {
		return this.pinyin;
	}
	
	public void setPinyin(java.lang.String value) {
		this.pinyin = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Cityid",getCityid())
			.append("Poid",getPoid())
			.append("Title",getTitle())
			.append("Pinyin",getPinyin())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getCityid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof TipRegionZoneCn == false) return false;
		if(this == obj) return true;
		TipRegionZoneCn other = (TipRegionZoneCn)obj;
		return new EqualsBuilder()
			.append(getCityid(),other.getCityid())
			.isEquals();
	}
	@Transient
	@Override
	public String getTarget() {
		// TODO Auto-generated method stub
		return null;
	}
	@Transient
	@Override
	public Long getTargetId() {
		// TODO Auto-generated method stub
		return null;
	}
	@Transient
	@Override
	public String getTargetName() {
		// TODO Auto-generated method stub
		return null;
	}
}

